import sys,re
def quchu(string):
  while 1:
    ret = re.search(r'\([^(]*?\)',string) 
    if ret:
      re_string = ret.group() 
      re_sj = suanfa(re_string.strip('()')) 
      string = string.replace(re_string,str(re_sj))
      continue
    break
  re_sj = suanfa(string)
  return float(re_sj)
def suanfa(re_string):
  while 1:
    ret = re.search(r'\d+\.*?\d*[*/]\-?\d+\.?\d*', re_string)
    if ret: 
      chengchu_string = ret.group() 
      res = chengchu(chengchu_string) 
      re_string = re_string.replace(chengchu_string, str(res)) 
      re_string =chulifuhao(re_string) 
      continue
    break
  num = re.findall(r'[+-]?\d+\.?\d*', re_string)
  if len(num) > 1:
    mynum = 0
    for i in num:
      mynum += float(i)
    return mynum
  else:
    return num[0]
def chengchu(string):
  if '*' in string:
    x,y = string.split('*')
    return float(x)*float(y) 
  if '/' in string:
    x, y = string.split('/')
    return float(x)/float(y)  
def chulifuhao(string):
  if '--' in string:
    string = string.replace('--','+')
  if '++' in string:
    string = string.replace('++','+')
  if '+-' in string:
    string = string.replace('+-','-')
  if '-+' in string:
    string = string.replace('-+','-')
  return string
	
if __name__ == "__main__":
  kscmd = sys.argv[1]
  star_n = kscmd.replace(' ', '')
  rets = quchu(star_n) 
  print("运算的最后结果为%s"%rets)